pp108 : Artifact Viewer (Object)

Artifact Viewer (Object)

An Artifact Viewer control is a container that displays artifacts. An artifact is a generic term that refers to objects or document types used in an application. The control offers various modes in which you can view the artifacts.

The Artifact Viewer control can be customized by modifying its property sheet. This control is derived from the AJAX Toolkit library - Artifact Viewer. For details about the control's behavior and functionality, see Artifact Viewer.

You can use the message map to create associations between this control and any required model. The mapping that you define between the control and the model is stored in a mapping object.

For information about the keyboard shortcuts available for the Artifact Viewer, see Keyboard Shortcuts.

Properties, Events, and Methods of the Control

The properties, events, and methods associated with the Artifact Viewer control define its behavior. You can set them either through the control's property sheet or programmatically using the APIs. For details, see Artifact Viewer.

The following XForms-related properties are available for the control:

Table 1. List of Properties

Design-time property

Run-time property

Description

ID

id

Sets the string that identifies the control on an XForm. If not specified, a unique ID is automatically generated.

Class Name

className

Sets or retrieves the class name applied on the control.

Artifact Factory

Sets the namespace of the Type Library which is used to extend the ArtifactFactory type.

Header

Denotes whether the header that displays tags (when tagging is used in an artifact viewer) is hidden or displayed. If selected, the header is not visible.

ViewMode

Sets the display mode of artifacts inside an artifact viewer. Possible values are Icon, List, Detail, Tiles, and Shortcut.

Scrolling Direction

Denotes the default scrolling direction for the artifacts in the artifact viewer. Possible values are Vertical and Horizontal.

Enable ContextMenu

Denotes whether the context menu is available for an artifact viewer or not. If selected, the context menu is available by default.

Allow Personalized Views

Denotes whether it is possible to create a personalized view when artifacts are sorted using tags in the artifact viewer.

Sort Artifacts on initialization

Denotes whether artifacts must be sorted or not when they are rendered. By default, the artifacts are sorted alphabetically.

Enable Find

Denotes whether the Find functionality (Ctrl+F) will be available on the artifact viewer.

Multiple Select

Denotes whether it is possible to select multiple artifacts in the artifact viewer.

Saves Preferences

Denotes whether it is possible to save user preferences. If selected, preferences are saved by default.

Arrange By

Sorts the artifacts based on the specified criteria. Possible values are mostrecentlyaccessed and name.

Sort Order

Sorts artifacts based on the alphabetical order. Possible values are Ascending or Descending.

Show As Selected

Denotes whether the selected artifacts will be kept in focus or not.

Table 2. List of Methods

Method

Description

addListener()

This method registers the control to receive notifications for an event.

removeListener()

This method unregisters the control to cease receiving notifications for its events.

Table 3. List of Events

Event

Description

onartifactclick

Fires when the artifact viewer is clicked.

onartifactdoubleclick

Fires when the artifact viewer is double-clicked.

onartifactselect

Fires when the artifact viewer is highlighted.

onafterconstructurl

Fires when the Copy URL or Make current selection as personalized view option is selected from the context menu of the artifact viewer.

oncontextmenu

Fires when the artifact viewer is right-clicked.

ontagselect

Fires when a tag is selected from a tag cloud, tagcrumb, or menu option for an artifact.

ontagremove

Fires when a tag is removed from a tag cloud or tagcrumb.